<%@page contentType="text/html;charset=utf-8" %>
<%@taglib prefix="s" uri="/struts-tags" %>   
<script type="text/javascript">

function pa_savephoneaddress(type)
{
    var id = document.getElementById("id").value;
    var upaddress = document.getElementById("upaddress").value;
    var sendcontent = document.getElementById("sendcontent").value;
    var remark = document.getElementById("remark").value;

    if (upaddress == null || upaddress == ""
        || sendcontent == null || sendcontent == "")
    {
        alert("信息不完整！");
        return false;
    }

    if (!confirm("确定继续？"))
    {
        return false;
    }
    var url = "mg/phoneaddress/save.do";
    var content = "type=" + type
                + "&model.id=" + id
                + "&model.upaddress=" + upaddress
                + "&model.sendcontent=" + sendcontent 
                + "&model.remark=" + remark;
    /*alert(content);*/
    var objectid = "content";
    sendXMLHttpRequest(url, content, objectid); 
}
function pa_showphoneaddress(id)
{
    var url = "mg/phoneaddress/show.do";
    var content = "";
    var objectid = "content";
    sendXMLHttpRequest(url, content, objectid); 
}
</script>
 <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="5"></td>
    <td>   
  <form id="myform">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td colspan="3">
        <table width="100%"  border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><img src="images/table_top_left.jpg" width="20" height="15" /></td>
            <td><img src="images/table_top_bg.jpg" width="770" height="15"/></td>
            <td align="right">
              <img src="images/table_top_right.jpg" width="20" height="15" /></td>
          </tr>
        </table>
      </td>
    </tr>
    <tr>
      <td height="25" colspan="3" class="table_blue">
        <strong><img src="images/dot.jpg" width="13" height="9">取号码信息</strong></td>
    </tr> 
    <tr>
      <td class="table_w1" width="20%">&nbsp;<font color="red">(*)</font>上行端口：</td>
      <td class="table_w2" colspan="2">&nbsp;
        <input id="id" type="hidden" value="<s:property value="model.id" />" >
        <textarea rows="3" cols="40" id="upaddress" name="upaddress"><s:property value="model.upaddress" /></textarea>
        <font color="red">&nbsp;多个端口中间以英文,隔开</font>
      </td>
    </tr>
    <tr>
      <td class="table_w1" width="20%">&nbsp;上行内容：</td>
      <td class="table_w2" colspan="2">&nbsp;
       <textarea rows="3" cols="40" id="sendcontent" name="sendcontent"><s:property value="model.sendcontent" /></textarea>
       </td>
    </tr>
    <tr>
      <td class="table_w1" width="20%">&nbsp;描述：</td>
      <td class="table_w2" colspan="2">&nbsp;
      	<textarea rows="3" cols="40" id="remark" name="remark"><s:property value="model.remark" /></textarea>
      </td>
    </tr>
    <tr>
      <td colspan="3" class="table_w1" align="center">
        <s:if test="type.equals('insert')" >
        <button id="btn2" dojoType="dijit.form.Button"
            onclick="pa_savephoneaddress('insert');">添加</button>
        </s:if>
        <s:else>
        <button id="btn2" dojoType="dijit.form.Button"
            onclick="pa_savephoneaddress('update');">修改</button>
        </s:else>
      </td>      
    </tr>
    <tr> 
      <td colspan="3" background="images/table_bom_bg.jpg">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td><img src="images/table_bom_left.jpg" width="20" height="15"></td>
          <td></td>
          <td align="right">
            <img src="images/table_bom_right.jpg" width="20" height="15"></td>
        </tr>
        </table>
      </td>
    </tr>
  </table>  
  </form>
  </td>
  <td width="5"></td>
  </tr>
  </table>